package cn.semcorp.zhuhaizj.listener;

import cn.semcorp.zhuhaizj.common.Common;
import cn.semcorp.zhuhaizj.exception.ServiceException;
import cn.semcorp.zhuhaizj.pojo.dto.CoatingDateDTO;
import cn.semcorp.zhuhaizj.pojo.dto.TrainingDataDTO;
import cn.semcorp.zhuhaizj.restful.ResponseCode;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


/**
 *
 */
public class ReadTrainingDateListener extends AnalysisEventListener<TrainingDataDTO> {
    /**
     * 读时aop
     * @param coatingDateDTO
     * @param analysisContext
     */
    static List<TrainingDataDTO> list = new ArrayList<>();
    @Override
    public void invoke(TrainingDataDTO trainingDataDTO, AnalysisContext analysisContext) {
        if (trainingDataDTO.getClassCode() == null){
            return;
        }
        list.add(trainingDataDTO);
    }

    /**
     * 读完aop
     * @param analysisContext
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    /**
     * 获取数据
     */
    public static List<TrainingDataDTO> getList(){
        return list;
    }
}
